local skel = fk.CreateSkill {
  name = "lb_zero__shanglei",
}

Fk:loadTranslationTable {
  ["lb_zero__shanglei"] = "殇蕾",
  [":lb_zero__shanglei"] = "游戏开始时，你指定一名其他角色；出牌阶段限一次，你可以对自己造成1点伤害，令该角色摸两张牌。",

  ["@lb_zero__shanglei"] = "殇蕾",

  ["#lb_zero__shanglei"] = "殇蕾：请选择一名其他角色成为〖殇蕾〗目标",
  ["#lb_zero__shanglei_draw"] = "殇蕾：你可以对自己造成1点伤害，令 %src 摸两张牌",

  ["$lb_zero__shanglei1"] = "法厄同大人，请看着薇薇安！",
  ["$lb_zero__shanglei2"] = "我从不会拒绝法厄同大人的邀请。",
}

skel:addEffect("active", {
  anim_type = "masochism",
  prompt = function (self, player, selected_cards, selected_targets)
    return "#lb_zero__shanglei_draw:" .. player:getMark("@lb_zero__shanglei").id
  end,
  can_use = function (self, player)
    return player:usedSkillTimes(skel.name, Player.HistoryPhase) == 0 and player:getMark("@lb_zero__shanglei") ~= 0
  end,
  target_num = 0,
  card_num = 0,
  on_use = function (self, room, skillUseEvent)
    local player = skillUseEvent.from
    local to = player:getMark("@lb_zero__shanglei")
    room:damage{
      from = player,
      to = player,
      skillName = skel.name,
      damage = 1,
    }
    if to ~= 0 and to:isAlive() then
      to:drawCards(2, skel.name)
    end
  end,
})

skel:addEffect(fk.GameStart, {
  is_delay_effect = true,
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name)
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    local tos = room:getOtherPlayers(player)
    if #tos > 1 then
      tos = room:askToChoosePlayers(player, {
        targets = tos,
        min_num = 1,
        max_num = 1,
        skill_name = skel.name,
        cancelable = false,
        prompt = "#lb_zero__shanglei",
      })
    end
    if #tos > 0 then
      event:setCostData(self, { tos = tos })
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    player.room:setPlayerMark(player, "@lb_zero__shanglei", event:getCostData(self).tos[1])
  end,
})

skel:addLoseEffect(function(self, player, is_death)
  player.room:setPlayerMark(player, "@lb_zero__shanglei", 0)
end)

return skel